<template>
  <div>
    <van-nav-bar
      title="设置"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <van-cell title="账号与安全" is-link :to="{name:'Safety'}" class="safety" />
    <van-cell title="新消息通知" is-link :to="{name:'NewInfo'}" class="newInfo" />
    <van-cell title="隐私" is-link :to="{name:'Privacy'}" class="privacy" />
    <van-cell title="通用" is-link :to="{name:'Universal'}" class="universal" />
    <van-cell title="关于我们" is-link  />
    <button tag="div" class="logout" @click="logout">退出登录</button>
  </div>
</template>

<script>
import {mapMutations} from 'vuex'
export default {
  name: "MySet",
  methods: {
    ...mapMutations('logMod',['remove']),
    logout() {
      localStorage.removeItem('user')
      this.remove()
      this.$router.push('/')
    },
    onClickLeft() {
      this.$router.back(); //返回按钮
    },
  },
  
};
</script>

<style scoped>
.safety {
  margin: 0.3rem 0;
}
.universal {
  margin-bottom: 0.3rem;
}
.logout {
  width: 100%;
  height: 0.9rem;
  background: #fff;
  margin-top: 1.3rem;
  line-height: 0.9rem;
  text-align: center;
  border: 1px solid transparent;
  outline: none;
}
</style>